/**
 * OSS is a Open Service Container which gives the leverage of building the Desktop and Web
 * Application. * Copyright (C) 2008-2009  Ponraj Sutanthiramani
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Or5e Open Source Community
 * 105, S.S Paradise Apartment, Munnireddy Layout, Horamavu, Banaswadi, Bangalore, India.
 */

package org.or5e.api.mp;
import java.io.File;
import java.net.URL;
import java.util.List;

import org.or5e.api.mp.playlist.Playlist;
import org.or5e.api.mp.playlist.PlaylistItem;
import org.or5e.core.OSGiEvents;

public interface MediaPlayer extends OSGiEvents {
	// ########## Life Cycle Operations ########## 
	public void init(String configFile) throws MediaException;
	public void destroy() throws MediaException;

	// ########## Player Operations ########## 
	public void play() throws MediaException;
	public void play(String playFile) throws MediaException; 
	public void play(URL playURL) throws MediaException;
	public Long pause() throws MediaException;
	public void resume(Long position) throws MediaException;
	public void seek(long duration) throws MediaException;
	public void stop() throws MediaException;
	public void next() throws MediaException;
	public void prev() throws MediaException;
	public void shuffle() throws MediaException;
	public void repeatTrack(Boolean flag) throws MediaException;
	public void repeatPlaylist(Boolean flag) throws MediaException;
	public Boolean isTrackRepeat() throws MediaException;
	public Boolean isPlaylistRepeat() throws MediaException;
	public Boolean isMuted() throws MediaException;
	public void setVolume(Float volumeLevel) throws MediaException;
	public Float getVolume() throws MediaException;
	public void mute(Boolean flag) throws MediaException;

	// ##########  Play List Operations ##########
	public List<Playlist> getAvailabilePlaylist() throws MediaException;
	public Playlist getCurrentPlayList() throws MediaException;
	public void setCurrentPlaylist(Playlist playList) throws MediaException;
	public List<PlaylistItem> getPlayListItems(Playlist playList) throws MediaException;
	public void addPlayListItem(Playlist playList, PlaylistItem item) throws MediaException;
	public void addPlayListItems(Playlist playList, List<PlaylistItem> items) throws MediaException;
	public void removePlayListItem(Playlist playList, PlaylistItem item) throws MediaException;
	public void removePlayListItems(Playlist playList, List<PlaylistItem> items) throws MediaException;

	// ########## Robot Operations  ##########
	public void makePlayListLookingUpSongFolder(File songsRootFolder, long delayReferesh) throws MediaException;
	
	// ########## Event Handling ##########
	public void addEventListener(MediaEventListener eListener) throws MediaException;
}